<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
  <head> 
	<%@ include file="/platform/style.jsp"%>
	<style>
		
	</style>
	<script>
	function query(){
		$w.execForm({pageNum:1})
	}
	function showinfo(id){
		$w.openDialog({url:ctx+'/order/OrderPage@show.page?bean.id='+id,title:"查看订单信息 ",w:700,h:450,maximized:true,afterClose:function(re){
			if(re)query();
		}});
	}
	function fahuo(id){
		window.parent.$w.openDialog({url:ctx+'/order/OrderPage@fahuoShow.page?bean.id='+id,title:"填写发货物流信息 ",w:600,h:300,afterClose:function(re){
			if(re){
				window.parent.$w.correctMsg("发货成功");
				query();
			}
		}});
	}
	function fahuo_win(id){
		window.parent.$w.openDialog({url:ctx+'/order/OrderPage@fahuoShow.page?bean.id='+id,title:"填写发货物流信息 ",w:600,h:300,afterClose:function(re){
			if(re){
				window.parent.$w.correctMsg("发货成功");
				$w.reloadCurrWin();
				query();
			}
		}});
	}
	function confirmorder(id){
		window.parent.$w.confirmMsg("是否已确认该订单？",function(re){
			if(re){
				$w.doUrl(ctx+"/order/OrderPage@orderconfirm.page?bean.orderid="+id,{},function(){query();});
			}
		})
	}
	</script>
  </head>
  
  <body class="easyui-layout">
	<div data-options="region:'center'" class="bodybg">
		<!-- 查询区域 -->
		<form id="queryForm" action="/order/OrderPage.page" method="post">
		<w:hidden bind="pageNum"/>
		<w:hidden bind="pageSize_"/>
		<table cellpadding="0" cellspacing="0" style="margin-top:5px">
			<tr>
				<td width="80" align="right">订单编号：</td><td><w:text bind="bean.code" style="width:90px;"/></td>
				<td width="80" align="right">用户名：</td><td><w:text bind="bean.loginname" style="width:90px;"/></td>
				<td width="80" align="right">企业名称：</td><td><w:text bind="bean.name" style="width:90px;"/></td>
				<td width="80" align="right">支付方式：</td><td><select name="bean.paytype"><option value="">-全部-</option><w:option bind="bean.paytype" value="1">在线支付</w:option><w:option bind="bean.paytype" value="2">货到付款</w:option></select></td>
				<td width="80" align="right">订单状态：</td><td><select name="bean.status"><option value="">-全部-</option><w:option bind="bean.status" value="1">待付款</w:option><w:option bind="bean.status"  value="2">待订单确认</w:option><w:option bind="bean.status" value="3">待发货</w:option><w:option bind="bean.status" value="7">待收货</w:option><w:option bind="bean.status" value="9">已 收货</w:option><w:option bind="bean.status" value="11">已完成</w:option><w:option bind="bean.status" value="13">已取消</w:option></select></td>
				<td width="80" align="right">下单时间：</td><td><w:text bind="bean.start" styleClass="easyui-datetimebox" style="width:95px"/>-<w:text bind="bean.end" styleClass="easyui-datetimebox" style="width:95px"/></td>
				<td>
					&nbsp;<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_search" onclick="query()">查询</a>
				</td>
			</tr>
		</table>
		<div class="ui_line" style="margin-top:10px"></div>
		<!-- 数据列表区域 -->
			<table class="ui-table" width="100%" cellpadding="1" cellspacing="1" data-options="showPage:true,
																								pageNum:<w:write bind="pageNum"/>,
																								pageSize:<w:write bind="pageSize_"/>,
																								total:<w:write bind="pagination.totalCount"/>">
				<thead>
					<tr class="ui_th">
						<td>订单编号</td>
						<td>下单时间</td>
						<td>订单总额</td>
						<td>应付金额</td>
						<td>支付方式</td>
						<td>支付状态</td>
						<td>用户名</td>
						<td>企业名称</td>
						<td>订单来源</td>
						<td>订单状态</td>
						<td>ERP状态</td>
						<td width="90" align="center">操作</td>
					</tr>
				</thead>
				<tbody>
				<w:iterate id="info" bind="resultList_">
					<tr class="ui_td">
						<td><w:write bind="#info.code"/></td>
						<td><w:write bind="#info.ordertime" format="yyyy-MM-dd HH:mm"/></td>
						<td>￥<w:write bind="#info.order_money"/></td>
						<td>￥<w:write bind="#info.pay_money"/></td>
						<td><w:write bind="#info.paytype" format="[,在线支付,货到付款]"/></td>
						<td><w:write bind="#info.ispay" format="[,成功]"/></td>
						<td><w:write bind="#info.username"/></td>
						<td><w:write bind="#info.name"/></td>
						<td><w:write bind="#info.source" defaultVal="PC端" format="[未知,PC端,微信]"/></td>
						<td><w:write bind="#info.status" enumClass="com.wframe.project.former.enums.OrderStatusEnum" enumKey="status" enumValue="name"/></td>
						<td><w:write bind="#info.issyn" enumClass="com.wframe.project.former.enums.OrderSynEnum" enumKey="status" enumValue="name"/></td>
						<td align="center">
							<p style="margin:3px;padding:0px;"><a href="javascript:void(0);" class="ui_btn" onclick="showinfo(<w:write bind="#info.id"/>)">查看订单</a></p>
							<w:equal bind="#info.status" value="2">
								<p style="margin:3px;padding:0px;"><a href="javascript:void(0);" class="ui_btn" onclick="confirmorder(<w:write bind="#info.id"/>)">确认订单</a></p>
							</w:equal>
							<w:equal bind="#info.status" value="3">
								<p style="margin:3px;padding:0px;"><a href="javascript:void(0);" class="ui_btn" onclick="fahuo(<w:write bind="#info.id"/>)">确定发货</a></p>
							</w:equal>
						</td>
					</tr>
				</w:iterate>
				<w:switch><w:case bind="resultList_.size()==0"><tr class="ui_td"><td colspan="12">没有订单信息！</td></tr></w:case></w:switch>
				</tbody>
			</table>
		</form>
	</div>
  </body>
</html>
